Skip to content

feat: add Avian as LLM provider#3369

Open
avianion wants to merge 2 commits intosimstudioai:mainfrom
avianion:feat/avian-provider
Open

feat: add Avian as LLM provider#3369
avianion wants to merge 2 commits intosimstudioai:mainfrom
avianion:feat/avian-provider

Conversation

@avianion
Copy link

Summary

Adds Avian as a new LLM provider. Avian is an OpenAI-compatible inference API offering competitive pricing on frontier models.

Models:

Model Context Window Input (per 1M) Output (per 1M)
deepseek/deepseek-v3.2 164K $0.26 $0.38
moonshotai/kimi-k2.5 131K $0.45 $2.20
z-ai/glm-5 131K $0.30 $2.55
minimax/minimax-m2.5 1M $0.30 $1.10

Features supported:

  • Chat completions
  • Streaming responses
  • Function/tool calling
  • Temperature control

Changes

  • components/icons.tsx — Add AvianIcon SVG component
  • providers/types.ts — Add 'avian' to ProviderId union type
  • providers/models.ts — Add Avian provider definition with model pricing and capabilities
  • providers/avian/index.ts — Provider implementation using OpenAI SDK (follows DeepSeek pattern)
  • providers/avian/utils.ts — Streaming utility using shared createOpenAICompatibleStream
  • providers/registry.ts — Register avianProvider in the provider registry
  • providers/utils.ts — Add Avian to provider metadata map

Implementation

The provider follows the same pattern as other OpenAI-compatible providers (DeepSeek, Cerebras). It uses the openai npm package with baseURL: 'https://api.avian.io/v1' and supports all standard features including tool calling loops, forced tool usage, and streaming with cost tracking.

Authentication is via user-provided API key (AVIAN_API_KEY as Bearer token).

Test plan

  • Verify Avian models appear in model selector dropdown
  • Test chat completion with deepseek/deepseek-v3.2 model
  • Test streaming response
  • Test function calling with a tool-enabled workflow
  • Verify cost tracking displays correct pricing

cc @waleedlatif1 @emir-karabeg

Add Avian (https://avian.io) as a new LLM provider with OpenAI-compatible
API support including chat completions, streaming, and function calling.

Models:
- deepseek/deepseek-v3.2 (164K context, $0.26/$0.38 per 1M tokens)
- moonshotai/kimi-k2.5 (131K context, $0.45/$2.20 per 1M tokens)
- z-ai/glm-5 (131K context, $0.30/$2.55 per 1M tokens)
- minimax/minimax-m2.5 (1M context, $0.30/$1.10 per 1M tokens)

Changes:
- Add AvianIcon to components/icons.tsx
- Add 'avian' to ProviderId type
- Add Avian provider definition with model pricing in models.ts
- Create providers/avian/ with index.ts and utils.ts
- Register provider in registry.ts and utils.ts
@vercel
Copy link

vercel bot commented Feb 27, 2026

@avianion is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Added Avian as a new LLM provider with OpenAI-compatible API integration. The implementation follows the established DeepSeek provider pattern, reusing proven architecture for OpenAI SDK-based providers. The integration includes proper tool calling support, streaming responses, cost tracking, and provider metadata registration. All 4 models are correctly configured with pricing and context window specifications.

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • The implementation is a well-executed pattern replication of the existing DeepSeek provider with appropriate naming changes. All imports follow established conventions, model definitions are accurate, and the provider is properly registered across all necessary files. No logic changes or risks introduced.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/providers/avian/index.ts New provider implementation following established DeepSeek pattern with OpenAI SDK, supports tool calling, streaming, and cost tracking
apps/sim/providers/models.ts Added Avian provider definition with 4 models, pricing, and configuration
apps/sim/providers/registry.ts Registered avianProvider in the provider registry map
apps/sim/providers/types.ts Added 'avian' to ProviderId union type
apps/sim/providers/utils.ts Added Avian to provider metadata map using buildProviderMetadata

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User selects Avian provider] --> B[Provider Registry]
    B --> C[avianProvider from /providers/avian/index.ts]
    C --> D[Initialize OpenAI SDK]
    D --> E[baseURL: api.avian.io/v1]
    E --> F{Request Type?}
    F -->|Streaming + No Tools| G[Create stream response]
    F -->|With Tools| H[Tool execution loop]
    F -->|Standard| I[Standard completion]
    H --> J[Execute tools with prepareToolsWithUsageControl]
    J --> K[Track forced tool usage]
    K --> L[Iterate up to MAX_TOOL_ITERATIONS]
    L --> M{Stream final?}
    M -->|Yes| G
    M -->|No| N[Return response with timing]
    G --> O[Calculate costs using model pricing]
    I --> O
    N --> O
    O --> P[Return to user with tokens & cost]
Loading

Last reviewed commit: f77f80c

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@avianion
Copy link
Author

avianion commented Mar 5, 2026

Friendly follow-up — this PR is still active and ready for review. Would appreciate a look when you get a chance! cc @waleedlatif1 @emir-karabeg

@avianion
Copy link
Author

avianion commented Mar 5, 2026

Friendly follow-up — this PR is still active and ready for review. All feedback has been addressed. Would appreciate a look when you get a chance! cc @waleedlatif1

@avianion
Copy link
Author

avianion commented Mar 5, 2026

Hey @waleedlatif1 @emir-karabeg — friendly follow-up on this PR. Avian is an OpenAI-compatible inference provider that's already live and powering apps like ISEKAI ZERO. This is a lightweight integration (standard OpenAI-compatible endpoint) and we're happy to address any feedback or make adjustments. Would love to get this merged if you have a moment to review. Thanks!

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cursor
Copy link

cursor bot commented Mar 8, 2026

PR Summary

Medium Risk
Adds a new third-party inference provider with streaming + tool-calling execution paths and registers it across provider selection/metadata, which could affect runtime behavior if request/response formatting differs from other OpenAI-compatible backends.

Overview
Adds Avian as a new LLM provider, including a full provider implementation (providers/avian) that uses the OpenAI SDK against https://api.avian.io/v1 and supports non-streaming, streaming, and iterative tool-calling with cost/timing tracking.

Wires Avian into the app by adding an AvianIcon, defining Avian models/pricing/capabilities in providers/models.ts, and registering 'avian' in provider types, provider registry, and client-safe provider metadata.

Written by Cursor Bugbot for commit f3ba0e7. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Mar 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 8, 2026 11:54pm

Request Review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

})
}
},
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~560-line provider duplicates DeepSeek implementation verbatim

Low Severity

The entire avian/index.ts (~560 lines) is a near-verbatim copy of deepseek/index.ts, differing only in the provider name string and base URL. The avian/utils.ts wrapper is also a trivial one-liner delegating to createOpenAICompatibleStream, identical in structure to deepseek/utils.ts, groq/utils.ts, etc. Given that a shared createOpenAICompatibleStream utility and checkForForcedToolUsageOpenAI helper already exist in providers/utils.ts, this full duplication increases maintenance burden — any future bug fix to the tool-calling loop, streaming, or cost tracking logic needs to be replicated across every copy-pasted provider.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant